//
//  XYCommon.m
//  Zhihuijinfu
//
//  Created by XY Lv on 17/3/21.
//  Copyright © 2017年 王笛. All rights reserved.
//

#import "XYCommon.h"

@implementation XYCommon
+ (CGSize)xy_getSizeWithStr:(NSString *)str font:(UIFont *)font maxSize:(CGSize)maxSize{
    NSDictionary * dict = @{NSFontAttributeName:font};
    CGSize size = [str boundingRectWithSize:maxSize options:NSStringDrawingTruncatesLastVisibleLine |
                   NSStringDrawingUsesLineFragmentOrigin |
                   NSStringDrawingUsesFontLeading attributes:dict context:nil].size;
    
    return size;
}


@end
